import '../utils/Settings.dart';
import '../utils/Utils.dart';
import '../utils/dio/DioMethod.dart';
import '../utils/dio/DioUtil.dart';

class UserApi{
  ///登录地址
  static const loginUrl = '${Settings.appServer}/AppLoginController/login';

  ///登录成功以后，获取用户信息的后台地址
  static const userInfoUrl = '${Settings.appServer}/AppLoginController/info';

  ///修改默认密码
  static const changeDefaultPwdUrl = '${Settings.appServer}/AppLoginController/changeDefaultPwd';

  ///用户登录
  static dynamic login (formData) async {
    // print(loginUrl);
    // print(formData);
    return await DioUtil.getInstance().request(loginUrl,method:DioMethod.post,data: formData);
  }

  ///查询用户信息
  static dynamic queryUserInfo () async {
    return await DioUtil.getInstance().request(userInfoUrl,method:DioMethod.get);
  }

  ///默认密码修改
  static dynamic changeDefaultPwd (formData) async {
    // print(loginUrl);
    // print(formData);
    return await DioUtil.getInstance().request(changeDefaultPwdUrl,method:DioMethod.post,data: formData);
  }
}